package com.plian.system.dao.fr.financeindicators;

import com.plian.Tools.pagedata.PageData;
import com.plian.system.dao.DaoSupport;
import com.plian.system.model.page.Page;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;

/**
* 说明：值标定义表
*/
@Component
public class  FinanceIndicatorsDao {
@Resource(name = "daoSupport")
private DaoSupport dao;

	/**
	* 新增
	* @param pd
	* @throws Exception
	*/
	public void save(PageData pd) throws Exception {
		dao.save("FinanceIndicatorsMapper.save",pd);
	}

	/**
	* 修改
	* @param pd
	* @throws Exception
	*/
	public void edit(PageData pd) throws Exception {
		dao.update("FinanceIndicatorsMapper.edit",pd);
	}

	/**
	* * 根据Id获取一条数据
	* @param
	* @return
	* @throws Exception
	*/
	public PageData findcountbycode(PageData pd) throws Exception {
		return (PageData) dao.findForObject("FinanceIndicatorsMapper.findcountbycode",pd);
	}
	/**
	 * * 根据Code获取一条数据
	 * @param
	 * @return
	 * @throws Exception
	 */
	public PageData findByCode(String code) throws Exception {
		return (PageData) dao.findForObject("FinanceIndicatorsMapper.findByCode",code);
	}
	/**
	 * * 根据code获取一条数据
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public PageData findbyid(String id) throws Exception {
		return (PageData) dao.findForObject("FinanceIndicatorsMapper.findbyid",id);
	}


	/**
	 * 预算表类型
	 * @return
	 * @throws Exception
	 */
	public List<PageData> findfilldeviation() throws Exception {
		return (List<PageData>) dao.findForList("FinanceIndicatorsMapper.findfilldeviation",null);
	}
	/**
	 * 预算表类型
	 * @return
	 * @throws Exception
	 */
	public List<PageData> findByDataSource(PageData pd) throws Exception {
		return (List<PageData>) dao.findForList("FinanceIndicatorsMapper.findByDataSource",pd);
	}
	/**
	 * * 根据Id获取一条数据
	 * @param name
	 * @return
	 * @throws Exception
	 */
	public PageData findbyname(String name) throws Exception {
		return (PageData) dao.findForObject("FinanceIndicatorsMapper.findbyname",name);
	}

	/**
	 * * 根据name获取一条预算指标数据
	 * @param name
	 * @return
	 * @throws Exception
	 */
	public PageData findBudgetbByName(String name) throws Exception {
		return (PageData) dao.findForObject("FinanceIndicatorsMapper.findBudgetbByName",name);
	}

	/**
	 * * 根据name获取一条快报指标数据
	 * @param name
	 * @return
	 * @throws Exception
	 */
	public PageData findIndicatorsByName(String name) throws Exception {
		return (PageData) dao.findForObject("FinanceIndicatorsMapper.findIndicatorsByName",name);
	}
	/**
	* 列表
	* @return
	* @throws Exception
	*/
	public List<PageData> listPage(Page page) throws Exception {
		return (List<PageData>) dao.findForList("FinanceIndicatorsMapper.listPage",page);
	}
	/**
	 * 预算表类型
	 * @return
	 * @throws Exception
	 */
	public List<PageData> findbudgettype(PageData pd) throws Exception {
		return (List<PageData>) dao.findForList("FinanceIndicatorsMapper.findbudgettype",pd);
	}
	/**
	* 批量删除
	* @return
	* @throws Exception
	*/
	public void del_ids(List<String> ids) throws Exception {
		dao.delete("FinanceIndicatorsMapper.del_ids",ids);
	}

	/**
	 * 预算表类型
	 * @return
	 * @throws Exception
	 */
	public List<PageData> findByCodes(PageData pd) throws Exception {
		return (List<PageData>) dao.findForList("FinanceIndicatorsMapper.findByCodes",pd);
	}
}
